<?php

require_once 'Zend/View/Helper/Abstract.php';

class Core_View_Helper_Jquery_JquerySortable extends Zend_View_Helper_Abstract
{
    /**
     * comments
     */
    public function jquerySortable($selector, $sortableClass = 'sortableItem')
    {
        $xhtml = "
                $('$selector').sortable(
                    {
                        accept :        '$sortableClass',
                        helperclass :   'sorthelper',
                        activeclass :   'sortableactive',
                        hoverclass :    'sortablehover',
                        opacity:        0.8,
                        fx:             200,
                        axis:           'vertically',
                        opacity:        0.4,
                        revert:         true,
                        handle:         '.handle',
                        placeholder:    'ui-state-highlight'
                    }
                );
                $('$selector').disableSelection();" . PHP_EOL;
        return $xhtml;
    }
}